package org.gienah.testing.test.mock;

import org.gienah.testing.junit.IContextLoader;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author Santiago L. Valdarrama
 */
public class MockContextLoader
		implements IContextLoader {
	
	private static MockConfigurableApplicationContext context = null;

	public ConfigurableApplicationContext loadContext(final String[] locations) {
		if (MockContextLoader.context == null) {
			return new MockConfigurableApplicationContext();
		}
		
		return MockContextLoader.context;
	}

	public static void setContext(final MockConfigurableApplicationContext context) {
		MockContextLoader.context = context;
	}

}